//
//  HYCompensateViewController.m
//  HaiYue
//
//  Created by skyline on 2018/1/12.
//  Copyright © 2018年 skyline. All rights reserved.
//

#import "HYCompensateViewController.h"
#import "HYReceivedVC.h"
#import "HYUnreceivedVC.h"
@interface HYCompensateViewController ()
@property (nonatomic, strong) HYReceivedVC *receivedVC;
@property (nonatomic, strong) HYUnreceivedVC *unreceivedVC;
@end

@implementation HYCompensateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.segNaviBar.items = @[@"未领取",@"已领取"];
    self.receivedVC.hidden = NO;
    self.unreceivedVC.hidden = NO;
    // Do any additional setup after loading the view.
}

- (HYReceivedVC *)receivedVC
{
    if (!_receivedVC)
    {
        _receivedVC = [[HYReceivedVC alloc] init];
        [self.scrollView addSubview:_receivedVC];
        [_receivedVC mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.scrollView);
            make.left.equalTo(self.scrollView);
            make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT - NAVIBAR_HEIGHT - STATUS_HEIGHT));
        }];
    }
    return _receivedVC;
}

- (HYUnreceivedVC *)unreceivedVC
{
    if (!_unreceivedVC)
    {
        _unreceivedVC = [[HYUnreceivedVC alloc] init];
        [self.scrollView addSubview:_unreceivedVC];
        [_unreceivedVC mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.scrollView);
            make.left.equalTo(self.scrollView).with.offset(SCREEN_WIDTH);
            make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT - NAVIBAR_HEIGHT - STATUS_HEIGHT));
        }];
    }
    return _unreceivedVC;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.leftNaviBarBtn.hidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
